import {http } from '@/utils/http'
import type { BannerItem,CategoryItem,GuessItem,HotItem } from '@/types/home'
import type { PageParams, PageResult,GoodsItem } from '@/types/global'
import type { HotResult } from '@/types/hot'

//封装的轮播图方法
export const getHomeBannerAPI = (distributionSite=1) =>{
    return http<BannerItem[]>({
        url:'/home/banner',
        method:'GET',
        data:{
            distributionSite
        }
    })
}

//封装-首页前台分类的小程序
export const getHomeCategoryApi = () => {
    return http<CategoryItem[]>({
      method: 'GET',
      url: '/home/category/mutli',
    })
  }

//热门产品
export const getHomeHotAPI = () => {
    return http<HotItem[]>({
      method: 'GET',
      url: '/home/hot/mutli',
    })
  }

//猜你喜欢
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}






